/*
 * @authors :Bin Mei
 * @date    :2017-08-02
 * @description：票交汇APP-h5 -> 数字滚动计数器
 */


import React, { Component} from 'react';
import classnames from 'classnames';
import CountUp from 'react-countup';
import './Count.scss';

let Counts = class extends Component {
  render() {
    let {className,start,end,decimals,duration}=this.props;
    return (
      <em className={classnames("countup-inline",{[`${className}`]:true})}>
        <CountUp 
          className="countup"
          separator={","}
          decimal="." 
          decimals={(decimals||2)}
          useGrouping={true}
          duration={(duration||2.75)}
          useEasing={true}
          start={(start||0)} end={(end||0)} />
      </em>
    )
  }
}

export default Counts;